package com.infore.siteManagement.OutSide.Controller;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.infore.siteManagement.OutSide.Service.IStatisAndAlarmService;
import com.infore.siteManagement.util.ResultEntity;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**暴露给数据分析预警外部接口**/
@Api(value = "被调用管理服务接口", tags = {"被调用管理服务接口"})
@RestController
@RequestMapping("/statisAndAlarm")
public class StatisAndAlarmOutController {

	@Autowired
	private IStatisAndAlarmService iStatisAndAlarmService;
	
	@ApiOperation(value = "根据站点code返回因子code")
    @ResponseBody
    @GetMapping(value = "/queryProjectByStationMn")
    public ResultEntity queryProjectByStationMn(@RequestParam(value = "stationMn",required = true) String stationMn) {
        return iStatisAndAlarmService.queryProjectByStationMn(stationMn);
    }
	
	@ApiOperation(value = "根据站点mn返回站点名称")
    @ResponseBody
    @GetMapping(value = "/queryNameByStationMn")
    public ResultEntity queryNameByStationMn(@RequestParam(value = "stationMn",required = true) String stationMn) {
        return iStatisAndAlarmService.queryNameByStationMn(stationMn);
    }
	
	@ApiOperation(value = "根据站点mn和因子返回站点因子发送频率")
    @ResponseBody
    @GetMapping(value = "/queryFrequencyByStationMn")
	public ResultEntity queryFrequencyByStationMn(@RequestParam(value = "stationMn",required = true) String stationMn, @RequestParam(value = "projId",required = true) String projId){
		return iStatisAndAlarmService.queryFrequencyByStationMn(stationMn, projId);
	}
	
	@ApiOperation(value = "根据站点mn和因子返回站点因子标准值")
	@ResponseBody
	@GetMapping(value = "/queryStandardByStationMn")
	public ResultEntity queryStandardByStationMn(@RequestParam(value = "stationMn",required = true) String stationMn, @RequestParam(value = "projId",required = true) String projId){
		return iStatisAndAlarmService.queryStandardByStationMn(stationMn, projId);
	}

	@ApiOperation(value = "根据区域编码/流域返回站点部分信息--综合分析")
    @ResponseBody
    @GetMapping(value = "/queryStationInfoByCodes")
    public ResultEntity queryStationInfoByCodes(@RequestParam(value = "queryCode",required = true) String queryCode,
    		@RequestParam(value = "queryType",required = true) String queryType,
    		@RequestParam(value = "userId",required = false) String userId,
    		@RequestParam(value = "platform",required = false) String platform,
    		@RequestParam(value = "appCode",required = false) String appCode,
    		@RequestParam(value = "admin",required = false) String admin) {
        return iStatisAndAlarmService.queryStationInfoByCodes(queryCode,queryType,userId,platform,appCode,admin);
    }
	
	@ApiOperation(value = "根据区域id拿到区域/流域信息")
    @ResponseBody
    @GetMapping(value = "/queryAreaByAreaCode")
    public ResultEntity queryAreaByAreaCode(@RequestParam(value = "queryCode",required = true) String queryCode,
    		@RequestParam(value = "queryType",required = true) String queryType) {
        return iStatisAndAlarmService.queryAreaByAreaCode(queryCode,queryType);
    }
	
	@ApiOperation(value = "根据mn拿到站点所有信息")
    @ResponseBody
    @GetMapping(value = "/queryAllInfoByMn")
    public ResultEntity queryAllInfoByMn(@RequestParam(value = "queryCode",required = true) String queryCode) {
        return iStatisAndAlarmService.queryAllInfoByMn(queryCode);
    }
	
	@ApiOperation(value = "根据站点mn获取因子信息")
    @ResponseBody
    @PostMapping(value = "/queryProjectByMn")
    public ResultEntity queryProjectByMn(@RequestParam(value="mns",required=false) List<String> mns) {
        return iStatisAndAlarmService.queryProjectByMn(mns);
    }
	
	@ApiOperation(value = "sdcjgyy水质地图根据mn拿到站点部分信息")
    @ResponseBody
    @GetMapping(value = "/queryInfoByMnSdcjgyy")
    public ResultEntity queryInfoByMnSdcjgyy(@RequestParam(value = "stationMns",required = true) String stationMns) {
        return iStatisAndAlarmService.queryInfoByMnSdcjgyy(stationMns);
    }
}
